<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

// 测试路由

// 实时监测获取河道归属位置信息
Route::get('/admin/coring/getmanagerrivers','Admin\Coring\CoringController@getManagerRivers');
// 实时监测获取河流core监测信息
Route::get('/admin/coring/alltimeinfo','Admin\Coring\CoringController@alltimeinfo');

// 报警响应 Datatables Ajax获取
Route::get('/admin/alarmanswer/alltimeinfo','Admin\Alarmanswer\AlarmanswerController@alltimeinfo');
// 报警响应 Datatables警报消除
Route::get('/admin/alarmanswer/cancel','Admin\Alarmanswer\AlarmanswerController@cancel');

// 注册微信wx.request报警信息请求接口
Route::get('/admin/weixin/alarminfo','Admin\Weixin\WeixinController@alarminfo');
// 注册微信wx.request河道实时监测信息接口
Route::get('/admin/weixin/alltimeinfo','Admin\Weixin\WeixinController@alltimeinfo');
// 注册微信wx.request的报警mp3接口
Route::get('/admin/weixin/alarmmusic','Admin\Weixin\WeixinController@alltimeinfo');
// 注册微信后台图片文件上传接口
Route::post('/admin/weixin/uploadimg','Admin\Weixin\WeixinController@imgUpload');
// 注册微信后台用户注册接口
Route::post('/admin/weixin/register','Admin\Weixin\WeixinController@register');
// 注册微信后台用户登录接口
Route::post('/admin/weixin/login', 'Admin\Weixin\WeixinController@login');
// 注册微信后台发送邮件接口
Route::post('admin/weixin/email', 'Admin\Weixin\WeixinController@email');
// 注册微信后台图片接收GET接口
Route::get('/admin/weixin/getimage', 'Admin\Weixin\WeixinController@getImage');

Route::group(['namespace' => 'Auth', 'middleware' => 'language'], function ($router)
{
	// login认证路由
	$router->get('login', 'LoginController@showLoginForm')->name('login');
	$router->post('login', 'LoginController@login');
	$router->post('logout', 'LoginController@logout');
	// register注册路由
	$router->get('register', 'RegisterController@showRegisterForm');
	$router->post('register','RegisterController@register');

});

Route::group(['prefix' => 'admin','namespace' => 'Admin', 'middleware' => ['auth', 'language']],function ($router)
{
	$router->get('/','HomeController@index');

	// 地图定位界面路由
	$router->resource('location','Location\LocationController');

	// 河道所有指标信息实时监测界面路由
	$router->resource('coring','Coring\CoringController');
	// Ajax get请求获取当前用户的管辖河道信息
	// $router->get('coring/getmanagerrivers','Coring\CoringController@getManagerRivers');
	// Ajax 实时监测动态展示河道具体信息
	// $router->get('coring/alltimeinfo','Coring\CoringController@alltimeinfo');

	// 报警响应界面路由
	$router->resource('alarmanswer','Alarmanswer\AlarmanswerController');

	// 评测指标界面路由
	$router->resource('evaluate','Evaluate\EvaluateController');
	// $router->get('evaluate/show','Evaluate\EvaluateController@show');

	// 统计分析界面路由
	$router->resource('analysis','Analysis\AnalysisController');

	// 河道管理界面路由
	$router->resource('rivers','Rivers\RiversController');

	// 微信小程序后台api测试接口
	$router->resource('weixin','Weixin\WeixinController@index');

	// 权限
	$router->resource('permission','PermissionController');
	// 角色
	$router->resource('role','RoleController');
	// 用户
	$router->resource('user','UserController');
	// 菜单
	$router->get('menu/clear','MenuController@cacheClear');
	$router->resource('menu','MenuController');
	$router->get('setting/{lang}', 'SettingController@language');
});
